<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			body{
				background-image:url(img/bg1.png) ;
				background-repeat:no-repeat ;
			}
			#dshow{
				width: 291px;
				height: 300px;
				background-image: url(img/arrow.png);
				position: absolute;
				left: 179px;
				top: 104px;
				cursor: pointer;
			}
		</style>
	</head>
	<body>
		<div id="dshow"></div>
	</body>
	<script type="text/javascript" src="js/jquery-1.11.0.js"></script>
	<script type="text/javascript" src="js/jq-rotate.js"></script>
	<!--jq插件旋转-->
	<script type="text/javascript">
		var num=0
		var i=0;
		$(function(){
			$('#dshow').click(function(){
				i++;
				if(i>=4){
					alert('只有3次机会哟');
					return
				}
				num=Math.random()*360;//转一圈乘以360
				$(this).rotate({
					duration:3000,//旋转一圈需要的时间
					angle:0,//旋转开始的起点
					animateTo:num+720,//旋转到哪里停止720的意思转2圈
					callback:function(){//怎么跑
						aRun()
					}
				})
			})
		})
		function aRun(){
			if(0<num&&num<=22.5){
				alert('亲 谢谢你的参与')
				return
			}else if(22.5<num&&num<=67.5){
				alert('代卷金5元');
				return
			}else if(67.5<num&&num<=112.5){
				alert('代卷金1元');
				return
			}else if(112.5<num&&num<=157.5){
				alert('代卷金10元');
				return
			}else if(157.5<num&&num<=202.5){
				alert('谢谢参与');
				return
			}else if(202.5<num&&num<=247.5){
				alert('代卷金20元');
				return
			}else if(247.5<num&&num<=292.5){
				alert('代卷金50元');
				return
			}else if(292.5<num&&num<=337.5){
				alert('代卷金30元');
				return
			}else{
				alert('亲 谢谢你的参与')
				return
			}
		}
	</script>
</html>
